const { ccclass, property, menu } = cc._decorator;
import EngineUtil from "./EngineUtil";
import UiManage from "./UiManage";
import ScrapingCardRewardtem from "./ScrapingCardRewardtem";
import UiManager from "./UiManage";

import n from "./EngineUtil"
import l from "./UiManage"
import s from "./ScrapingCardRewardtem"


@ccclass
export default class ScrapingCardRewardtemCtrl extends cc.Component {
    public ui;
    public onLoad() {
        this.onUILoad();
        this.addButtonListen();
    };
    public start() { };
    public onUILoad() {
        this.ui = this.node.addComponent(s);
    };
    public addButtonListen() { };
    public initData(e) {
        if (e) {
            var t = e.reward_type, a = n.getCashBalance(e.reward_count);
            if (1 == t) {
                this.ui.cashNode.active = true;
                var o = "<b><outline color=#038231 width=1><color=#FFFFFF>" + a + "元 </color></outline></b>";
                this.ui.cashCountLabel.getComponent(cc.RichText).string = o;
            } else this.ui.cashNode.active = false;
            var i = "reward_" + t;
            UiManager.loadSpriteFrame(this.ui.reward, "scrapingCardReward", i);
        }
    };

    static prefabUrl = "assets/resources/prefabs/ScrapingCardRewardtem";
    static className = "ScrapingCardRewardtemCtrl";
}


